{extend name="default/template/base_index" /}


{block name="area_header"}
    <link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
    <script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="__CDN__/jquery-validation/1.13.1/jquery.validate.min.js"></script>
	<script type="text/javascript" src="__CDN__/jquery-validation/1.13.1/localization/messages_zh.min.js"></script>
	
    <script type="text/javascript" charset="utf-8" src="__UPLOAD__/ueditor/1.4.3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__UPLOAD__/ueditor/1.4.3/ueditor.all.min.js"> </script>
	<link type="text/css" rel="stylesheet" href="__CDN__/comp/wxuploader.css?v=__APP_VERSION__" />
	<link type="text/css" rel="stylesheet" href="__CDN__/jquery-uploadify/3.2.1/uploadify.css" />
	<script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>

{/block}

{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}
		
			<!-- 带验证 form -->
			<form class="form-horizontal well validateForm">
				<input type="hidden" name="id" value="{$vo.id}" />
				<fieldset>
					<legend>
						</legend>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">活动标题</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short" value="{$vo.title}" name="title" id="inputtitle" placeholder="{:L('PLACEHOLDER_TITLE')}">
							<div class="help-block">(请输入活动标题)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">活动状态</label>
						<div class="col-md-10 col-lg-10">
							<label class="radio-inline">
								<input type="radio" name="act_status" value="0"  {eq name="vo.act_status" value="0"}checked="checked"{/eq}  />募集中
							</label>
							<label class="radio-inline">
								<input type="radio" name="act_status" value="1"  {eq name="vo.act_status" value="1"}checked="checked"{/eq}  />进行中
							</label>
							<label class="radio-inline">
								<input type="radio" name="act_status" value="2"  {eq name="vo.act_status" value="2"}checked="checked"{/eq}  />已结束
							</label>
						</div>
					</div>

					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">活动缩略图</label>
						<div class="col-md-10 col-lg-10">
							<input type="hidden" name="img" id="img" value="{$vo.img}" />
							<div class="wxuploaderimg clearfix {notempty name="vo.img"}checked{/notempty}" data-maxitems="1">
								<div class="img-preview clearfix" >
									{notempty name="vo.img"}
											<div class="pull-left clearfix img-item">
												<img src="{$vo.img}" />
												<div class="edit_pic_wrp"><a href="javascript:;" class="fa fa-lg fa-trash js_delete"></a></div>
											</div>
									{/notempty}
								</div>
								<div class="add">
									<i class="fa fa-plus"></i>
								</div>
							</div>
							
						</div>




					<div class="form-group">
						<label for="inputpost_excerpt" class="col-md-2 col-lg-2 control-label">活动分类</label>
						<div class="col-md-10 col-lg-10">
							<select name="dtree_type" CLASS="form-control input-normal" >
								{:w_datatree(6235,true,$vo['dtree_type'],1)}
							</select>
							<div class="help-block">(请选择文章分类)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">活动积分</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short" name="integral" value="{$vo.integral}">
							<div class="help-block">(参与活动可获得积分)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">活动人数</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short" name="people_num" value="{$vo.people_num}">
							<div class="help-block">(活动需要人数)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">活动详情</label>
						<div class="col-md-6 col-lg-6">
							 <script id="ueditor" name="content" type="text/plain" style="height: 480px;" >{$vo.content}</script>
						</div>
						<a class="btn btn-default" href="http://wxbj.cn/" target=_blank><i class="fa fa-reply"></i>微信文章详情布局</a>
						<div class="help-block">(如链接打不开直接百度搜索:微信文章编辑器)</div>
					</div>


					<div class="form-group">
						<label for="btns" class="col-md-2 col-lg-2 control-label">&nbsp;</label>
						<div class="col-lg-10 col-md-10">
							<a target-form="validateForm" class="ajax-post btn btn-primary" onclick="return getData();" href="{:url('Activity/edit')}" autofocus="autofocus"><i class="fa fa-save"></i> {:L('BTN_SAVE')}</a>
							<a class="btn btn-default" href="{:url('Activity/index')}"><i class="fa fa-reply"></i>返回</a>
						</div>
					</div>
				</fieldset>
			</form>
			<!-- form -->
			
			{include file="default/template/wxpicture" /}
		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
{/block}

{block name="area_footer"}

<script>
    var ue = UE.getEditor('ueditor',{
    	toolbars:[
        ['fullscreen', 'source', 'undo', 'redo', 'bold','italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', '|','lineheight'
       , 'fontsize','justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', 'insertimage','insertvideo','emotion','link', 'unlink', 'anchor', '|','map','print', 'preview',  'drafts','forecolor','backcolor'
        ]
    ]});
    ue.ready(function(){
    		var cont = '{:htmlspecialchars_decode($vo['content'])}';
    		ue.setContent(cont);
    });
	</script>
	<script type="text/javascript">
		
		function getData(){
			$("#img").val($(".wxuploaderimg img").attr("src"));
		}

		$(function(){
			wxuploadimg.init({cont:".wxuploaderimg"});

			$('#starttime').datetimepicker({
				lang: 'ch'
			});
			$('#endtime').datetimepicker({
				lang: 'ch'
			});
		})
	</script>
{/block}